<template>
  <div>
    <el-row>
      <el-col :span="12"
        ><div class="grid-content">
          <v-chart :options="option1" :watchShallow="true" :auto-resize="true" :style="{ width: '100%', height: '100%' }" /></div
      ></el-col>
      <el-col :span="12"
        ><div class="grid-content">
          <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="year" label="年度"> </el-table-column>
            <el-table-column prop="month" label="月份"> </el-table-column>
            <el-table-column prop="cost" label="费用"> </el-table-column>
            <el-table-column prop="num" label="数量(笔数)"> </el-table-column>
            <el-table-column prop="money" label="金额"> </el-table-column>
          </el-table></div
      ></el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <div class="grid-content"><v-chart :options="option2" :watchShallow="true" :auto-resize="true" :style="{ width: '100%', height: '100%' }" /></div>
      </el-col>
      <el-col :span="12"
        ><div class="grid-content">
          <el-table :data="monthData" style="width: 100%">
            <el-table-column prop="numOne" label="笔数(12月份)"> </el-table-column>
            <el-table-column prop="costOne" label="金额(12月份)"> </el-table-column>
            <el-table-column prop="numTwo" label="笔数(11月份)"> </el-table-column>
            <el-table-column prop="costTwo" label="金额(11月份)"> </el-table-column>
            <el-table-column prop="numThree" label="笔数(10月份)"> </el-table-column>
            <el-table-column prop="costThree" label="金额(10月份)"> </el-table-column>
          </el-table></div
      ></el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  name: 'stafftransfer',
  data() {
    return {
      option1: {
        title: {
          text: '费用信息统计',
          left: 'center'
        },
        xAxis: {
          type: 'category',
          data: ['总费用', '已报账费用', '未报账费用']
        },
        yAxis: {
          type: 'value'
        },
        label: {
          show: true,
          position: 'top',
          color: '#333333'
        },
        legend: {
          data: ['数量(笔数)', '金额', 'Income'],
          bottom: 0
        },
        series: [
          {
            name: '数量(笔数)',
            type: 'bar',
            data: [12, 10, 2],
            itemStyle: {
              color: '#4874cb'
            }
          },
          {
            name: '金额',
            data: [10982, 9983, 999],
            type: 'bar',
            itemStyle: {
              color: '#ee822f'
            }
          }
        ]
      },
      option2: {
        title: {
          text: '费用信息统计',
          left: 'center'
        },
        xAxis: {
          type: 'category',
          data: ['12月', '11月', '10月']
        },
        yAxis: {
          type: 'value'
        },
        legend: {
          data: ['总费用', '已报账费用', '未报账费用'],
          bottom: 0
        },
        series: [
          {
            name: '总费用',
            data: [12, 15, 21],
            type: 'line'
          },
          {
            name: '总费用',
            data: [10982, 30200, 25900],
            type: 'line'
          },
          {
            name: '已报账费用',
            data: [10, 14, 21],
            type: 'line'
          },
          {
            name: '已报账费用',
            data: [10982, 30200, 25900],
            type: 'line'
          },
          {
            name: '未报账费用',
            data: [2, 1, 0],
            type: 'line'
          },
          {
            name: '未报账费用',
            data: [999, 700, 0],
            type: 'line'
          }
        ]
      },
      tableData: [
        {
          year: '23年',
          month: '12月份',
          cost: '总费用',
          num: 12,
          money: 10982
        },
        {
          year: '23年',
          month: '12月份',
          cost: '已报账费用',
          num: 10,
          money: 9983
        },
        {
          year: '23年',
          month: '12月份',
          cost: '未报账费用',
          num: 2,
          money: 999
        }
      ],
      monthData: [
        {
          numOne: 12,
          costOne: 10982,
          numTwo: 15,
          costTwo: 30200,
          numThree: 21,
          costThree: 25900
        },
        {
          numOne: 10,
          costOne: 9983,
          numTwo: 14,
          costTwo: 29500,
          numThree: 21,
          costThree: 25900
        },
        {
          numOne: 2,
          costOne: 999,
          numTwo: 1,
          costTwo: 700,
          numThree: 0,
          costThree: 0
        }
      ]
    };
  }
};
</script>
<style lang="scss" scoped>
.grid-content {
  height: 50vh;
  margin-top: 20px;
}
.table-sty {
  margin: 20px;
}
</style>
